﻿using BCCommon;
using BCDto.TMS.FreightAddress;
using BCDto.Website.User;
using System.Collections.Generic;

namespace BCService.TMS.FreightAddressService
{
    public interface IFreightAddressService
    {
        /// <summary>
        /// 获取货运常用地址
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="longitude">经度</param>
        /// <param name="latitude">纬度</param>
        /// <returns></returns>
        FreightAddressDto Get(long userId, double longitude, double latitude);
        /// <summary>
        /// 获取货运常用地址
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="countyId">区县Id</param>
        /// <param name="communityId">城市Id</param>
        /// <param name="provinceId">省份Id</param>
        /// <param name="address">地址</param>
        /// <returns></returns>
        FreightAddressDto Get(long userId, string countyId, string communityId, string provinceId, string address);
        /// <summary>
        /// 新增常用地址
        /// </summary>
        /// <param name="user">用户端信息</param>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        FreightAddressDto Add(UserDto user, FreightAddressRequestDto requestDto);

        /// <summary>
        /// 修改常用地址
        /// </summary>
        /// <param name="freightAddressId"></param>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        int Update(long freightAddressId, FreightAddressRequestDto requestDto);

        /// <summary>
        /// 修改使用次数
        /// </summary>
        /// <param name="freightAddressId"></param>
        /// <returns></returns>
        int UpdateUserCount(long freightAddressId);

        /// <summary>
        /// 通过货运常用地址id查询
        /// </summary>
        /// <param name="freightAddressId">货运常用地址ID</param>
        /// <returns></returns>
        FreightAddressDto GetById(long freightAddressId);

        /// <summary>
        /// 获取用户常用地址列表
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        List<FreightAddressDto> GetListByUserId(long userId);

        /// <summary>
        /// 分页列表
        /// </summary>
        /// <param name="pageIndex">起始页</param>
        /// <param name="pageSize">页数量</param>
        /// <param name="userName">用户名称</param>
        /// <param name="phone">手机号</param>
        /// <returns></returns>
        PageableList<FreightAddressDto> GetAll(int pageIndex, int pageSize, string userName, string phone);
    }
}